var hx = require("hbuilderx");
// const buildH5 = require('./commands/buildH5')
// const buildWgt = require('./commands/buildWgt')
const BuildPackager = require('./commands/build')
const setUploadServe = require('./commands/setUploadServe')

//该方法将在插件激活的时候调用
function activate(context) {
	const buildPackager = new BuildPackager()
	// 打包H5
	let buildH5Command = hx.commands.registerCommand('extension.buildH5', () => {
		buildPackager.build('h5')
	});
	context.subscriptions.push(buildH5Command);

	// 打包wgt
	let buildWgtCommand = hx.commands.registerCommand('extension.buildWgt', () => {
		buildPackager.build('wgt')
	});
	context.subscriptions.push(buildWgtCommand);

	// 设置上传服务器
	const setUploadServeWgtCommand = hx.commands.registerCommand('extension.setUploadServeWgt', () => {
		setUploadServe('wgt')
	})
	context.subscriptions.push(setUploadServeWgtCommand);

	const setUploadServeH5Command = hx.commands.registerCommand('extension.setUploadServeH5', () => {
		setUploadServe('h5')
	})
	context.subscriptions.push(setUploadServeH5Command);
}
//该方法将在插件禁用的时候调用（目前是在插件卸载的时候触发）
function deactivate() {

}

module.exports = {
	activate,
	deactivate
}